package com.play;

import java.util.Scanner;

public class Player {
    private int levelNo;//玩家当前级别号
    private int curScore;//玩家当前级别积分
    private long startTime = 0;//当前级别开始时间
    private long elapsedTime;//当前级别已用时间

    public Player() {
    }

    public Player(int levelNo, int curScore, long startTime, long elapsedTime) {
       this.setLevelNo(levelNo);
       this.setCurScore(curScore);
       this.setStartTime(startTime);
       this.setElapsedTime(elapsedTime);
    }

    public int getLevelNo() {
        return levelNo;
    }

    public void setLevelNo(int levelNo) {
        this.levelNo = levelNo;
    }

    public int getCurScore() {
        return curScore;
    }

    public void setCurScore(int curScore) {
        this.curScore = curScore;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(long elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public void play(){
        Game game = new Game(this);
        Scanner in = new Scanner(System.in);
        for (int i = 0; i < LevelParam.levels.length; i++) {
            this.levelNo += 1;
            this.startTime = System.currentTimeMillis();
            this.curScore = 0;
            for (int j = 0; j < LevelParam.levels[levelNo - 1].getStrLength(); j++) {
                String outStr = game.printStr();
                String inStr = in.next();
                game.printResult(outStr,inStr);
            }
        }
    }
}
